////////////////////////////////////////////////////////////////////////////
//
//  Crytek Engine Source File.
//  Copyright (C), Crytek Studios, 2010.
// -------------------------------------------------------------------------
//  File name:   ParticleMemory.cpp
//  Version:     v1.00
//  Created:     18/03/2010 by Corey Spink
//  Compilers:   Visual Studio.NET
//  Description: All the particle system's specific memory needs
// -------------------------------------------------------------------------
//  History:
//
////////////////////////////////////////////////////////////////////////////

#include "StdAfx.h"
#include "ParticleMemory.h"
#include "Cry3DEngineBase.h"

// Initialize the heap, using cvar to set page and max allocation size. 
// if 0, use 64 KB page size, with no page limit.

static int ParticlePoolBytes()
{
	return (Cry3DEngineBase::GetCVars()->e_ParticlesPoolSize + Cry3DEngineBase::GetCVars()->e_ParticlesEmitterPoolSize) << 10;
}

CParticleHeap::CParticleHeap()
	: CParticleHeapBase
		(
			max(ParticlePoolBytes(), 1 << 16),
			FHeap().SinglePage(ParticlePoolBytes() != 0)
		)
{
}
